package com.mzm.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.mzm.domain.ProductInfo;
import com.mzm.util.persistency.GenericJpaDaoImpl;

@Repository("productInfoDao")
public class ProductInfoDao extends GenericJpaDaoImpl<ProductInfo, Integer> {

	public ProductInfoDao() {
		super(ProductInfo.class);
	}
	
	public List<ProductInfo> getProductInfos(String path){
		List<ProductInfo> matchingNodes = getJpaTemplate().find(
				"SELECT " +
				"	p " +
				"FROM " +
				"	com.mzm.domain.ProductInfo p " +
				"WHERE " +
				"	p.category.path=?1",
				path);
		return matchingNodes;
	}
}
